/**
 * 应用列表弹窗控件
 */

(function() {
    "use strict"

    var that;
    function AppBox(dom) {
        // 添加应用
        this.add = function(json) {
            var block = document.createElement("a");
            block.style.cssText += ";background:white;display:inline-block;float:left;width:48px;height:48px;margin:1px;cursor:pointer;border-radius:4px;";
            var btn = document.createElement("div");
            btn.style.cssText += ";float:left;width:32px;height:32px;";
            btn.style.cssText += ";background:url("+json.image+") no-repeat;";
            btn.style.cssText += ";margin-left:8px;";
            var text = document.createElement("div");
            text.style.cssText += ";float:left;width:48px;height:.7rem;font-size:.5rem;text-align:center;color:#333;";
            text.innerText = json.name;
            block.appendChild(btn);
            block.appendChild(text);
            block.href = json.src;
            dom.appendChild(block);
        };
    }
    window.AppBox = AppBox;
})();